import java.util.Scanner;

public class demo03 {
    //最大公约数和最小公倍数问题
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x=sc.nextInt();
        int y=sc.nextInt();
        int count=0;
        for (int i = x; i <= y; i++) {
            for (int j = x; j <= y; j++) {
                int maxnum=max(i,j);
                int minnum=i*j/maxnum;
                if(maxnum==x&&minnum==y){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
    public static int max(int a,int b){
        while (a%b!=0){
            int c=a%b;
            a=b;
            b=c;
        }
        return b;
    }
}
